// #ifndef _YOLO_BOX_H
// #define _YOLO_BOX_H
#pragma once

#define OPENCV 4.1.1

#include <math.h>
#include <omp.h>
#include <unistd.h>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include <fstream>
#include <iostream>
#include <mutex>
#include <opencv2/core/version.hpp>
#include <opencv2/opencv.hpp>
#include <string>
#include <thread>
#include <vector>
#include "MyDahuaCam.h"
#include "yolo_v2_class.hpp"

class Cam : public Detector
{
public:
    Cam(const std::string names, const std::string cfgFile, const std::string weights);
    void grab(void); //用于多线程抓图
    void getImg(void);
    //  bool DetectLog(const cv::Mat& InputImg, std::vector<std::vector<cv::Point>>& LPoints, std::vector<int>& Tags);
    void detectLag(const cv::Mat& inputImg);
    void getLag(std::vector<std::vector<cv::Point>>& Lpoints, std::vector<int>& tags);
    bool getOriginImg(cv::Mat& outputImg);

private:
    cv::Mat m_originImg;
    std::vector<int> tags_;
    std::vector<std::vector<cv::Point>> Lpoints_;
    cv::Mat Lagori_;
    std::mutex Lag_Mut;
    std::vector<bbox_t> Lag_Boxs;
    std::vector<std::string> m_names;
    boost::mutex Log_Mut;
    int m_width, m_height;
    int m_r, m_g, m_b;
    std::vector<double> m_balance;
    int m_exposure;
    int m_gama;
    int m_sharpness;
    int m_brightness;
    int m_blacklevel;
    int m_digitalshift;
    int m_gainraw;
};
// #endif